/**
 * @team Dynamic Duo
 * 1. Maayan Keshet
 * 2. Gal Bitensky
 */

import java.util.LinkedList;
import java.util.List;

import lex.Dump;
import lex.Lexer;
import lex.Token;


public class Main
{

	public static void main(String[] args)
	{

		try {
			Lexer lex = new Lexer();
			List<Token> tokens = new LinkedList<Token>();
			Error err = null;
			try {
				lex.process(args[0], tokens);
			} catch (Error e) {
					err = e;
			}
			Dump d = new Dump(args[0], tokens);
			d.consolePrintTable();
			if (err != null) {
				System.out.println(err.getMessage());
			}
			//d.printTableToFile();
		}
		catch (Exception e) {
			System.err.println(e);
		}
	}
}